package com.sc.nft.admin.controller;

import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.dto.BeVerifiedAndQualifiedDTO;
import com.sc.nft.dto.ObtainApprovalListDTO;
import com.sc.nft.dto.RefusalOfApprovalDTO;
import com.sc.nft.feign.MerchantDepositApprovalClient;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import com.sc.nft.vo.ObtainApprovalListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 保证金审批表(MerchantDepositApproval)表控制层
 *
 * @author wwc
 * @since 2023-03-28 11:03:28
 */

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("admin/merchantDepositApproval")
@Api(tags = "保证金审批操作")
public class MerchantDepositApprovalController {

    private final MerchantDepositApprovalClient merchantDepositApprovalClient;

    @PostMapping(value = "refusalOfApproval", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "拒绝审批", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result refusalOfApproval(@RequestBody RefusalOfApprovalDTO refusalOfApprovalDTO) {
        return merchantDepositApprovalClient.refusalOfApproval(refusalOfApprovalDTO);
    }

    @PostMapping(value = "beVerifiedAndQualified", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "通过审批", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result beVerifiedAndQualified(@RequestBody BeVerifiedAndQualifiedDTO beVerifiedAndQualifiedDTO) {
        return merchantDepositApprovalClient.beVerifiedAndQualified(beVerifiedAndQualifiedDTO);
    }

    @PostMapping(value = "obtainApprovalList", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "获取审批列表", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public PageResult<ObtainApprovalListVO> obtainApprovalList(@RequestBody ObtainApprovalListDTO obtainApprovalListDTO) {
        return merchantDepositApprovalClient.obtainApprovalList(obtainApprovalListDTO);
    }

}
